package es.udc.emarketapp.emarket.model.purchase.purchaseFacade.actions;


import es.udc.emarketapp.emarket.model.orderLine.dao.SQLOrderLineDAO;
import es.udc.emarketapp.emarket.model.orderLine.dao.SQLOrderLineDAOFactory;
import es.udc.emarketapp.emarket.model.orderLine.vo.OrderLineVO;

import java.sql.Connection;

import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.exceptions.ModelException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;

public class CreateOrderLineAction implements TransactionalPlainAction {

    private OrderLineVO orderLineVO;

    public CreateOrderLineAction(OrderLineVO orderLineVO) {
        this.orderLineVO = orderLineVO;
    }

    public Object execute(Connection connection)
            throws InternalErrorException, ModelException {

        SQLOrderLineDAO orderLineDAO = SQLOrderLineDAOFactory.getDAO();
        
            return orderLineDAO.create(connection, orderLineVO);

    }
}
